package lib.bone.flow.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * 流程流转附加信息
 * @author : kindear
 */
@Data
@Entity
@Table(name = "flow_attach")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@EntityListeners(AuditingEntityListener.class)
public class FlowAttach {
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @ApiModelProperty(value = "流程流转信息ID",name = "id")
    String id;

    /**
     * 流程实例ID
     */
    @ApiModelProperty("流程实例ID")
    @Column(name = "flow_work_id")
    String flowWorkId;

    /**
     * 流程节点ID 发生该操作的节点
     */
    @ApiModelProperty("流程节点ID")
    @Column(name = "flow_node_id")
    String flowNodeId;

    @ApiModelProperty("流程节点名称")
    @Column(name = "flow_node_name")
    String flowNodeName;

    @ApiModelProperty("流程操作人ID")
    @Column(name = "act_user_id")
    String actUserId;

    @ApiModelProperty("流程操作人")
    @Column(name = "act_user_name")
    String actUserName;

    @ApiModelProperty("流程流转附加信息")
    @Column(name = "attach")
    String attach;

    @ApiModelProperty("流程流转操作")
    @Column(name = "flow_task_handle")
    String flowTaskHandle;

    @CreatedDate
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "记录创建时间",name = "createdTime")
    @Column(name = "created_time")
    private Date createdTime;
    @LastModifiedDate
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @ApiModelProperty(value = "记录更新时间",name = "updatedTime")
    @Column(name = "updated_time")
    private Date updatedTime;
}
